const state = () => ({
  admin: false,
  role: [],
  permission: [],
  buttons: [],
  menus: [],
  searches: [],
})
const getters = {
  admin: (state) => state.admin,
  role: (state) => state.role,
  permission: (state) => state.permission,
  buttons: (state) => state.buttons,
  menus: (state) => state.menus,
  searches: (state) => state.searches,
}
const mutations = {
  setFull(state, admin) {
    state.admin = admin
  },
  setRole(state, role) {
    state.role = role
  },
  setPermission(state, permission) {
    state.permission = permission
  },
  setButtons(state, buttons) {
    state.buttons = buttons
  },
  setMenus(state, menus) {
    state.menus = menus
  },
  setSearches(state, searches) {
    state.searches = searches
  },
}
const actions = {
  setFull({ commit }, admin) {
    commit('setFull', admin)
  },
  setRole({ commit }, role) {
    commit('setRole', role)
  },
  setPermission({ commit }, permission) {
    commit('setPermission', permission)
  },
  setButtons({ commit }, buttons) {
    commit('setButtons', buttons)
  },
  setMenus({ commit }, menus) {
    commit('setMenus', menus)
  },
  setSearches({ commit }, searches) {
    commit('setSearches', searches)
  },
}
export default { state, getters, mutations, actions }
